-
Notifications
You must be signed in to change notification settings - Fork 2
Luau Implementation #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready for another review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly some format issues, and I feel like this could be merged after solving these. What do you think @bennn?
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
Signed-off-by: Dibri Nsofor <[email protected]>
This is all set to be merged. Maybe a final review @hanwenguo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
back to you
return x is String | ||
``` | ||
|
||
Since Luau, does not currently provide a direct way to connect a function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete the comma
iterable. Other notable mentions are `~=` for the not operator and `_` as a | ||
prefix to silence warnings to unused definitions. | ||
|
||
Example: `#x` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this code example right below the sentence about length. It's not clear up above what the syntax actually is for getting the length of an iterable.
|
||
> Q. Are any examples inexpressible? Why? | ||
|
||
No. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR doesn't implement the examples! Either add an implementation and update this section, or replace the answers here with "N/A: the examples are future work.".
|
||
A Table in Luau is the base data structure for constructing complex objects or | ||
organizing data. This implementation adopts `tables` for Lists, Structs and to | ||
construct aliases for `Pairs` and `Tuples`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pairs
and Tuples
should be Pair
and Triple
-- Example alias | ||
-- success | ||
function _alias_success_f(x: unknown): unknown | ||
local y = typeof(x) == "number" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: number
should be string
to match the benchmark.
|
||
-- failure | ||
function _predicate_checked_failure_f(x: string | number | boolean): never | ||
-- not representable in Luau (v0.657) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation
end | ||
|
||
function _predicate_checked_failure_g(x: string | number | boolean): never | ||
-- not representable in Luau (v0.657) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation
error("not representable in Luau (v0.657)") | ||
end | ||
|
||
-- Example object_properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to struct_fields
return 0 | ||
end | ||
return x + 1 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add newline at end of file
@@ -19,6 +20,7 @@ The tested versions are: | |||
| Flow | 0.245.2 | See [`Flow/package-lock.json`](https://github.com/utahplt/ot-benchmark/blob/main/Flow/package-lock.json) | | |||
| Pyright | 1.1.389 | See [`Pyright/package-lock.json`](https://github.com/utahplt/ot-benchmark/blob/main/Pyright/package-lock.json) | | |||
| mypy | 1.13.0 | See [`mypy/requirements.txt`](https://github.com/utahplt/ot-benchmark/blob/main/mypy/requirements.txt) | | |||
| Luau | 0.657 | [Luau 0.657](https://github.com/luau-lang/luau/releases/tag/0.657) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add indentation so the columns match previous rows
Also, this ought to have a (In the future we should just have |
Luau implementation of the ifT benchmark with datasheet.